projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e68d0d2
)
ostbuild: Ensure user chroot mounts are not shared
author
Colin Walters
<walters@verbum.org>
Tue, 6 Dec 2011 17:18:17 +0000
(12:18 -0500)
committer
Colin Walters
<walters@verbum.org>
Tue, 6 Dec 2011 17:18:17 +0000
(12:18 -0500)
It's possible that the root filesystem mount is global; we need
to undo that in order to be sure that our "private" bind mounts
really are private.
src/ostbuild/ostbuild-user-chroot.c
patch
|
blob
|
history
diff --git
a/src/ostbuild/ostbuild-user-chroot.c
b/src/ostbuild/ostbuild-user-chroot.c
index 80267485f74cbbd5b948bbfe9f2e4154b9ad8cc2..c0ed1a2bd4c7b803ee002578ea3035f05627d3b1 100644
(file)
--- a/
src/ostbuild/ostbuild-user-chroot.c
+++ b/
src/ostbuild/ostbuild-user-chroot.c
@@
-98,6
+98,9
@@
main (int argc,
if (unshare (CLONE_NEWNS) < 0)
fatal_errno ("unshare (CLONE_NEWNS)");
+ if (mount ("/", "/", "none", MS_PRIVATE, NULL) < 0)
+ fatal_errno ("mount(/, MS_PRIVATE)");
+
initialize_chroot (chroot_dir);
if (chroot (chroot_dir) < 0)